package com.hl.service.impl;

import java.util.List;

import com.hl.mapper.HuishouMemberMapper;
import com.hl.service.HuishouMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import com.hl.mapper.LiliShopMemberMapper;
import com.hl.domain.LiliShopMember;

/**
 * 回收站Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-06
 */
@Service
@Primary
public class HuishouMemberServiceImpl implements HuishouMemberService
{
    @Autowired
    private HuishouMemberMapper huishouMemberMapper;
@Autowired
private PasswordEncoder passwordEncoder;
    /**
     * 查询回收站
     * 
     * @param memberId 回收站主键
     * @return 回收站
     */
    @Override
    public LiliShopMember selectHuishouMemberByMemberId(String memberId)
    {
        return huishouMemberMapper.selectHuishouMemberByMemberId(memberId);
    }

    /**
     * 查询回收站列表
     * 
     * @param huishouMember 回收站
     * @return 回收站
     */
    @Override
    public List<LiliShopMember> selectHuishouMemberList(LiliShopMember huishouMember)
    {
        return huishouMemberMapper.selectHuishouMemberList(huishouMember);
    }

    /**
     * 新增回收站
     * 
     * @param huishouMember 回收站
     * @return 结果
     */
    @Override
    public int insertHuishouMember(LiliShopMember huishouMember)
    {
        return huishouMemberMapper.insertHuishouMember(huishouMember);
    }

    /**
     * 修改回收站
     * 
     * @param huishouMember 回收站
     * @return 结果
     */
    @Override
    public int updateHuishouMember(LiliShopMember huishouMember)
    {
        //密码加密
        huishouMember.setPassword(passwordEncoder.encode(huishouMember.getPassword()));
        return huishouMemberMapper.updateHuishouMember(huishouMember);
    }

    /**
     * 批量删除回收站
     * 
     * @param memberIds 需要删除的回收站主键
     * @return 结果
     */
    @Override
    public int deleteHuishouMemberByMemberIds(String[] memberIds)
    {
        return huishouMemberMapper.deleteHuishouMemberByMemberIds(memberIds);
    }

    /**
     * 删除回收站信息
     * 
     * @param memberId 回收站主键
     * @return 结果
     */
    @Override
    public int deleteHuishouMemberByMemberId(String memberId)
    {
        return huishouMemberMapper.deleteHuishouMemberByMemberId(memberId);
    }
}
